<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>
        ${title}
    </title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="<%=basePath%>/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="<%=basePath%>/css/font-awesome.min.css">
    <link rel="stylesheet" href="<%=basePath%>/css/ionicons.min.css">
    <link rel="stylesheet" href="<%=basePath%>/dist/css/AdminLTE.min.css">
    <link rel="stylesheet" href="<%=basePath%>/toastr/toastr.css" type="text/css"/>
    <link rel="stylesheet" href="<%=basePath%>/dist/css/skins/_all-skins.min.css">
    <link rel="stylesheet" href="<%=basePath%>/fileupload/fileinput.min.css"/>
    <link rel="stylesheet" href="<%=basePath%>/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css">
    <link rel="stylesheet" href="<%=basePath%>/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css">
    <link rel="stylesheet" href="<%=basePath%>/plugins/iCheck/all.css">
    <link rel="stylesheet" href="<%=basePath%>/pagination/style/pagination.css" media="screen">
    <link rel="stylesheet" href="<%=basePath%>/plugins/iziModal/css/iziModal.min.css">
    <link rel="stylesheet" href="<%=basePath%>/plugins/select2/select2.min.css">
    <link rel="stylesheet" href="<%=basePath%>/plugins/iCheck/all.css">
    <link rel="stylesheet" href="<%=basePath%>/plugins/loaders/loaders.css"/>
    <link rel="stylesheet" href="<%=basePath%>/plugins/flavr/animate.css"/>
    <link rel="stylesheet" href="<%=basePath%>/plugins/flavr/flavr.css"/>
    <link rel="stylesheet" href="<%=basePath%>/plugins/bootstrap-treeview/css/bootstrap-treeview.css">
    <link rel="stylesheet" href="<%=basePath%>/plugins/viewer/viewer.min.css">
    <style>
        li{
            list-style: none;
        }
    </style>
</head>
<!-- ADD THE CLASS sidedar-collapse TO HIDE THE SIDEBAR PRIOR TO LOADING THE SITE -->
<body class="hold-transition skin-blue sidebar-mini">
<div id="request-div" style="position: absolute;width: 100%;height: 100%;z-index: 10;display: none;">
    <img src='../images/request-sending.gif' style="position: relative;top: 50%;left: 50%;width: 70px;height: 70px">
</div>
<!-- Site wrapper -->
<div class="wrapper">
    <header class="main-header">
        <!-- Logo -->
        <jsp:include page="../logo.jsp" ></jsp:include >
        <!-- Header Navbar: style can be found in header.less -->
        <nav class="navbar navbar-fixed-top">
            <!-- Sidebar toggle button-->
            <a class="sidebar-toggle" data-toggle="offcanvas" role="button" onclick="show()">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </a>
            <jsp:include page="../menuTop.jsp"></jsp:include>
        </nav>
    </header>

    <input type="hidden" value="${id}" id="deviceId" name="deviceId">
    <input type="hidden" value="<%=basePath%>" id="basePath">

    <!-- Left side column. contains the sidebar -->
    <aside class="main-sidebar">
        <jsp:include page="../menu.jsp"></jsp:include>
        <!-- /.sidebar -->
    </aside>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper" style="padding-top:50px;">
        <section class="content-header">
            <ol class="breadcrumb">
                <li class="text-muted"><i class="fa fa-th"></i>&nbsp;&nbsp;设备管理</li>
                <li class="text-muted"><i class="fa fa-circle-o"></i>&nbsp;&nbsp;设备详情</li>
            </ol>
        </section>
        <section class="content">
            <div class="row">
                <div class="col-md-12 right-part">
                    <div class="nav-tabs-custom">
                        <ul class="nav nav-tabs">
                            <%--<li class="active"><a href="#assetsPresentation" data-toggle="tab">运行报告</a></li>--%>
                            <li class="active"><a href="#info" data-toggle="tab">设备信息</a></li>
                            <li><a href="#contract" data-toggle="tab">合同信息</a> </li>
                            <li><a href="#timeline" data-toggle="tab">重大事件</a></li>
                         <%--   <li><a href="#paramter-info" data-toggle="tab">参数信息</a></li>--%>
                            <li><a href="#file" data-toggle="tab">文件档案</a></li>
                            <li><a href="#repair" data-toggle="tab">维修历史</a></li>

                        </ul>
                        <li class="tab-content" style="min-height: 600px">
                            <!-- 设备运行报告 -->
                            <div class="tab-pane" id="assetsPresentation">
                                <div class="col-md-12">
                                    <p style="padding-bottom: 5px;border-bottom: 1px solid #aaa">
                                        <span style="font-size: 18px">运行报告</span>
                                    </p>
                                    <div class="col-md-6" id="chartA" style="height:350px"></div>
                                    <div class="col-md-6">
                                        <div class="report-div">
                                            <p style="padding: 15px"><span style="font-size: 16px">报告详情</span></p>
                                            <div style="padding-left: 25px">
                                                <p>
                                                    <label><a class='list-info' href="javascript:showService(1)" >维修次数：</a></label><span id="repair-time">1</span>次
                                                </p>
                                                <p>
                                                    <label><a class='list-info' href="javascript:showService(2)" >保养次数：</a></label><span id="upkeep-time">1</span>次
                                                </p>
                                                <p>
                                                    <label><a class='list-info' href="javascript:showService(3)" >保养计划次数：</a></label><span id="upkeep-plan-time">1</span>次
                                                </p>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <p style="padding-bottom: 5px;border-bottom: 1px solid #aaa"><span style="font-size: 18px">总结</span></p>
                                    <div class="col-md-6 text-center">
                                        <img src="../images/summary.png">
                                    </div>
                                    <div class="col-md-6 text-left" style="font-size: 14px">
                                        <p>
                                            <span>使用年限(年)：</span>
                                            <span id="serviceLife">4</span>
                                        </p>
                                        <p>
                                            <span>故障时间（天）：</span>
                                            <span id="failureTime">10</span>
                                        </p>
                                        <p>
                                            <span>维修工时（小时）：</span>
                                            <span id="maintenanceHour">500</span>
                                        </p>
                                        <p>
                                            <span>有效工作天数：</span>
                                            <span id="workingDays">390</span>
                                        </p>
                                    </div>
                                </div>
                                <table class="table table-striped table-bordered"></table>
                            </div>
                            <div class="active tab-pane" id="info">
                                <table class="table table-striped table-bordered">
                                    <tr>
                                        <td colspan="6" class="text-left col-md-12 info"><label>&nbsp;&nbsp;设备详情</label></td>
                                    </tr>
                                    <tr>
                                        <td class="text-right"><label class="text-muted">设备名称：</label></td>
                                        <td class="text-left"><span id="deviceNameSpan"></span></td>
                                        <td class="text-right"><label class="text-muted">设备型号：</label></td>
                                        <td class="text-left"><span id="deviceModelSpan"></span></td>
                                        <td class="text-right"><label class="text-muted">设备序列号：</label></td>
                                        <td class="text-left"><span id="snSpan"></span></td>
                                    </tr>
                                    <c:if test="${loginUser.type != '1101'}">
                                        <tr id="hospital">
                                            <td class="text-right" ><label class="text-muted">医院：</label></td>
                                            <td class="text-left" colspan="5" ><span id="hospitalNameSpan"></span></td>
                                        </tr>
                                    </c:if>
                                    <tr>
                                        <td class="text-right"><label class="text-muted">厂商：</label></td>
                                        <td class="text-left"><span id="manufacturerNameSpan"></span></td>
                                        <td class="text-right"><label class="text-muted">经销商：</label></td>
                                        <td class="text-left"><span id="supplierNameSpan"></span></td>
                                        <td class="text-right"><label class="text-muted">维修商：</label></td>
                                        <td class="text-left"><span id="maintainerNameSpan"></span></td>
                                    </tr>
                                    <tr>
                                        <td class="text-right" ><label class="text-muted">科室：</label></td>
                                        <td class="text-left" ><span id="departmentSpan"></span></td>
                                        <td class="text-right" ><label class="text-muted">资产编号：</label></td>
                                        <td class="text-left" ><span id="assetsNoSpan"></span></td>
                                        <td class="text-right" ><label class="text-muted">产地：</label></td>
                                        <td class="text-left"><span id="placeOriginSpan"></span></td>
                                    </tr>

                                    <tr>
                                        <td class="text-right"><label class="text-muted">规格：</label></td>
                                        <td class="text-left"><span id="specificationsSpan"></span></td>
                                        <td class="text-right"><label class="text-muted">单价(元)：</label></td>
                                        <td class="text-left"><span id="priceSpan"></span></td>
                                        <td class="text-right"><label class="text-muted">数量：</label></td>
                                        <td class="text-left"><span id="quantitySpan"></span></td>
                                    </tr>
                                    <tr>
                                        <td class="text-right" ><label class="text-muted">出厂日期：</label></td>
                                        <td class="text-left" ><span id="manufactureDateSpan"></span></td>
                                        <td class="text-right" ><label class="text-muted">附件：</label></td>
                                        <td class="text-left" ><span id="attachmentSpan"></span></td>
                                        <td class="text-right" ><label class="text-muted">保养周期(月)：</label></td>
                                        <td class="text-left" ><span id="upkeepCycleSpan"></span></td>

                                    </tr>
                                        <td class="text-right" ><label class="text-muted">上次保养时间：</label></td>
                                        <td class="text-left"><span id="lastUpkeepDateSpan"></span></td>
                                        <td class="text-right" ><label class="text-muted">下次保养时间：</label></td>
                                        <td class="text-left" ><span id="nextUpkeepDateSpan"></span></td>
                                        <td class="text-right" ><label class="text-muted">设备状态：</label></td>
                                        <td class="text-left" ><span id="deviceStatusItemSpan"></span></td>
                                    <tr>
                                        <td class="text-right" ><label class="text-muted">安装日期：</label></td>
                                        <td class="text-left" ><span id="installDateSpan"></span></td>
                                        <td class="text-right" ><label class="text-muted">验收日期：</label></td>
                                        <td class="text-left" ><span id="acceptanceDateSpan"></span></td>
                                        <td class="text-right" ><label class="text-muted">购买日期：</label></td>
                                        <td class="text-left"><span id="purchaseDateSpan"></span></td>
                                    </tr>
                                    <tr>
                                        <td class="text-right" ><label class="text-muted">启用日期：</label></td>
                                        <td class="text-left"><span id="enableTimeSpan"></span></td>
                                        <td class="text-right" ><label class="text-muted">68分类一级：</label></td>
                                        <td class="text-left" ><span id="deviceTypeNameSpan"></span></td>
                                        <td class="text-right" ><label class="text-muted">68分类二级：</label></td>
                                        <td class="text-left" ><span id="deviceTypeSubNameSpan"></span></td>
                                    </tr>
                                    <tr>
                                        <td class="text-right" ><label class="text-muted">负责人：</label></td>
                                        <td class="text-left" ><span id="responsiblePersonSpan"></span></td>
                                        <td class="text-right" ><label class="text-muted">厂家维保结束日期：</label></td>
                                        <td class="text-left" ><span class="manufacturerLastDateSpan"></span></td>
                                        <td class="text-right" ><label class="text-muted">经销商维保结束日期：</label></td>
                                        <td class="text-left" ><span class="supplierLastDateSpan"></span></td>
                                    </tr>
                                    <tr>
                                        <td class="text-right" ><label class="text-muted">保修情况：</label></td>
                                        <td class="text-left" ><span class="medicalSecuritySpan"></span></td>
                                        <td class="text-right" ><label class="text-muted">备注：</label></td>
                                        <td class="text-left" colspan="3" ><span id="remarkSpan"></span></td>
                                    </tr>
                                </table>
                            </div>

                            <div class="tab-pane" id="contract">
                                <table class="table table-striped table-bordered">
                                    <tr>
                                        <td colspan="6" class="text-left col-md-12 info"><label>&nbsp;&nbsp;合同信息</label></td>
                                    </tr>
                                    <tr class="contract">
                                        <td class="text-right"><label class="text-muted">合同编号：</label></td>
                                        <td class="text-left"><span id="contractNoSpan"></span></td>
                                        <td class="text-right"><label class="text-muted">甲方：</label></td>
                                        <td class="text-left"><span id="firstPartyNameSpan"></span></td>
                                        <td class="text-right"><label class="text-muted">乙方：</label></td>
                                        <td class="text-left"><span id="secondPartyNameSpan"></span></td>
                                    </tr>
                                    <tr class="contract">
                                        <td class="text-right"><label class="text-muted">合同签订时间：</label></td>
                                        <td class="text-left"><span id="signDateSpan"></span></td>
                                        <td class="text-right"><label class="text-muted">厂家保修期(月)：</label></td>
                                        <td class="text-left"><span id="deviceWarrantyPeriodSpan"></span></td>
                                        <td class="text-right"><label class="text-muted">供应商保修期(月)：</label></td>
                                        <td class="text-left"><span id="supplierWarrantyPeriodSpan"></span></td>

                                    </tr>
                                    <tr class="contract">
                                        <td class="text-right" ><label class="text-muted">厂家维保结束日期：</label></td>
                                        <td class="text-left" ><span class="manufacturerLastDateSpan"></span></td>
                                        <td class="text-right" ><label class="text-muted">经销商维保结束日期：</label></td>
                                        <td class="text-left" ><span class="supplierLastDateSpan"></span></td>
                                        <td class="text-right" ><label class="text-muted">保修情况：</label></td>
                                        <td class="text-left" ><span class="medicalSecuritySpan"></span></td>
                                    </tr>
                                    <tr class="contract">
                                        <td class="text-right"><label class="text-muted">备注：</label></td>
                                        <td class="text-left" colspan="5"><span id="contractRemarkSpan"></span></td>
                                    </tr>

                                </table>
                            </div>

                            <div class="tab-pane" id="paramter-info">
                                <table class="table table-bordered table-hover">
                                    <thead>
                                    <tr class='text-info'>
                                        <th class="text-left">参数</th>
                                        <th class="text-left">参数类型</th>
                                        <th class="text-left">值</th>
                                    </tr>
                                    </thead>
                                    <tbody id="group-info-body"></tbody>
                                </table>
                            </div>

                            <!-- 文件管理 -->
                            <div class="tab-pane table-responsive" id="file"
                                 style="min-height: 600px">
                                <div class="box-body table-responsive no-padding">
                                    <table class="table table-bordered ">
                                        <thead>
                                        <tr class="info">
                                            <th class="text-center text-muted" style="width: 35px">#</th>
                                            <th class="text-center text-muted">文件类型</th>
                                            <th class="text-center text-muted">文件名</th>
                                            <th class="text-center text-muted">签发日期</th>
                                            <th class="text-center text-muted">到期日期</th>
                                            <th class="text-center text-muted">文件大小</th>
                                            <th class="text-center text-muted">文件下载</th>
                                        </tr>
                                        </thead>
                                        <tbody id="device_file_list">


                                        </tbody>
                                    </table>
                                </div>
                            </div>

                            <!-- 维修历史 -->
                            <div class="tab-pane table-responsive" id="repair"
                                 style="min-height: 600px">
                                <div class="box-body table-responsive no-padding">
                                    <table class="table table-bordered ">
                                        <thead>
                                        <tr class="info">
                                            <th class="text-center text-muted" style="width: 35px">#</th>
                                            <th class="text-center text-muted" style="width: 20px">详情</th>
                                            <th class="text-center text-muted">报修时间</th>
                                            <th class="text-center text-muted">故障时间</th>
                                            <th class="text-center text-muted">状态</th>
                                        </tr>
                                        </thead>
                                        <tbody id="device_repair_list">


                                        </tbody>
                                    </table>
                                </div>
                            </div>

                            <div class="tab-pane" id="timeline" style="min-height: 600px">
                                <ul class="timeline timeline-inverse" id="timeAxis">
                                    <li><i class='fa fa-wrench' style='color: #fff;background:#f9b229'></i>
                                        <div class='timeline-item'>
                                            <h3 class='timeline-header' style='background: #fff'>
                                                <span style='color: #000'>2017-08-28 10:57</span>
                                            </h3>
                                            <div class='timeline-body'>
                                                <span style='color: #5082eb'>【报修】</span>
                                                红房子医院(设备科)对设备进行了报修
                                            </div>
                                            <div>
                                            </div>
                                        </div>
                                    </li>
                                    <li><i class='fa fa-clock-o bg-gray'></i></li>
                                </ul>
                            </div>
                        </li>

                        <%--<button style="margin-left: 15px;margin-bottom: 15px" id="reback-btn" class="btn btn-info" title="">
                            <span class="fa fa-mail-reply"></span>
                            <span style="margin-left: 5px">返回</span>
                        </button>--%>
                    </div>
                </div>
            </div>
            <!-- /.col -->
    </section>
    </div>

    <div id="list-model" style="display: none;">
        <div class="box-body">
            <table id="clickRepairCount-table" class="max-td table table-bordered table-hover">
                <thead>
                <tr class="text-info">
                    <td>序号</td>
                    <td>详情</td>
                    <td>设备名称</td>
                    <td>设备型号</td>
                    <td>医院</td>
                    <td>故障时间</td>
                    <td>设备状态</td>
                    <td>是否更换备件</td>
                    <td>报修人</td>
                </tr>
                </thead>
                <tbody>
                    <td>1</td>
                    <td><button type="button" class="btn btn-primary btn-xs" data-original-title="详情"><i class="fa fa-file-text-o"></i></button></td>
                    <td>新增设备1</td>
                    <td>sg2637211</td>
                    <td>红房子</td>
                    <td>2018-1-1</td>
                    <td>故障</td>
                    <td>是</td>
                    <td>刘晓</td>
                </tbody>
            </table>
            <table id="clickUpkeepCount-table" class="max-td table table-bordered table-hover">
                <thead>
                <tr class="text-info">
                    <td>序号</td>
                    <td>详情</td>
                    <td>设备名称</td>
                    <td>医院</td>
                    <td>保养时间</td>
                </tr>
                </thead>
                <tbody>
                    <td>1</td>
                    <td><button type="button" class="btn btn-primary btn-xs" data-original-title="详情"><i class="fa fa-file-text-o"></i></button></td>
                    <td>新增设备1</td>
                    <td>红房子</td>
                    <td>2017-11-3</td>
                </tbody>
            </table>
            <table id="clickUpkeepPlanCount-table" class="max-td table table-bordered table-hover">
                <thead>
                <tr class="text-info">
                    <td>序号</td>
                    <td>设备名称</td>
                    <td>设备序列号</td>
                    <td>设备型号</td>
                    <td>计划保养时间</td>
                </tr>
                </thead>
                <tbody>
                    <td>1</td>
                    <td>新增设备1</td>
                    <td>SN1001</td>
                    <td>MV2911</td>
                    <td>2017-11-1</td>
                </tbody>
            </table>
        </div>
        <div class="box-footer">
            <span class="pull-right">
                <button data-iziModal-close class="btn btn-default" style="margin-right: 5px">关闭</button>
            </span>
        </div>
    </div>


    <div id="file_show_modal"></div>

    <footer class="main-footer">
        <div class="pull-right hidden-xs">
            <b>Version</b> 1.0.0
        </div>
        <strong>Copyright &copy; 2019 <a href="http://almsaeedstudio.com">Topmed</a>.</strong> All rights reserved.
    </footer>
    <jsp:include page="../menuRight.jsp"></jsp:include>
<!-- ./wrapper -->

<!-- ./wrapper -->
<script src="<%=basePath%>/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script src="<%=basePath%>/bootstrap/js/bootstrap.min.js"></script>
<script src="<%=basePath%>/plugins/slimScroll/jquery.slimscroll.min.js"></script>
<script src="<%=basePath%>/plugins/fastclick/fastclick.js"></script>
<script src="<%=basePath%>/dist/js/app.min.js"></script>
<script src="<%=basePath%>/dist/js/demo.js"></script>
<script src="<%=basePath%>/bootstrapvalidator/js/bootstrapValidator.min.js"></script>
<script src="<%=basePath%>/toastr/toastr.js"></script>
<script src="<%=basePath%>/pagination/js/jquery.pagination.min.js"></script>
<script src="<%=basePath%>/js/overallSituation.js"></script>
<script src="<%=basePath%>/fileupload/fileinput.min.js"></script>
<script src="<%=basePath%>/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script src="<%=basePath%>/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="<%=basePath%>/plugins/select2/select2.min.js"></script>
<script src="<%=basePath%>/plugins/select2/i18n/zh-CN.js"></script>
<script src="<%=basePath%>/plugins/iCheck/icheck.min.js"></script>
<script src="<%=basePath%>/plugins/iziModal/js/iziModal.min.js"></script>
<script src="<%=basePath%>/plugins/flavr/flavr.min.js"></script>
<script src="<%=basePath%>/plugins/bootstrap-treeview/js/bootstrap-treeview.js"></script>
<script src="<%=basePath%>/echarts/echarts.min.js"></script>
<script src="<%=basePath%>/js/device/device-info.js"></script>
<script src="<%=basePath%>/plugins/viewer/viewer.min.js"></script>
</body>
</html>
